package com.yanqu.road.server.cmd.beautyescort;

import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.beautyescort.BeautyEscortProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_BEAUTY_ESCORT_GET_UNION_MEMBER_DATA_TO_CROSS, desc = "商会成员贡献榜")
public class CrossBeautyEscortRankMemberDataCmdFromServer extends CrossCommand {

    BeautyEscortProto.CrossBeautyEscortRankMemberDataRespMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = BeautyEscortProto.CrossBeautyEscortRankMemberDataRespMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        BeautyEscortProto.BeautyEscortRankMemberDataRespMsg.Builder respMsg = BeautyEscortProto.BeautyEscortRankMemberDataRespMsg.newBuilder();
        respMsg.setRet(0);
        respMsg.addAllData(reqMsg.getDataList());
        MessageHelper.sendPacket(reqMsg.getPlayerServerId(), reqMsg.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.U_BEAUTY_ESCORT_GET_UNION_MEMBER_DATA, respMsg));
    }

    @Override
    public void sendData() {

    }
}
